/*
  EOMono
  Copyright 2007, Adam Tauno Williams (Whitemice Consulting)
  License: LGPLv2  < http://www.gnu.org/licenses/lgpl-2.1.html >
 */
using System;

namespace Whitemice.EOMono
{
  public class EOField : EOFieldDef
  {   
    protected object  value;
    
    public EOField(string _name, string _kind) : base(_name, _kind)
    {
    }
    
    public EOField(string _name, string _kind, bool _isPKey) : base(_name, _kind, _isPKey)
    {
    }
    
    public EOField(string _name, string _kind, bool _isPKey, object _defaultValue)
      : base (_name, _kind, _isPKey, _defaultValue)
    {
    }        
    
    protected override void Init(string _name, string _kind, bool _isPKey, object _defaultValue)
    {
      base.Init(_name, _kind, _isPKey, _defaultValue);
      if (_defaultValue != null)
        value = _defaultValue;
      else value = null;
    }
        
    internal object GetValue()
    {
      return value;
    }

    internal object SetValue(object _value)
    {
      value = _value;
    }    
  }
}
